IP_ROUTER_ALERT(2const)

πŸ“¦
version 6.20 Β· 4 versions
, in arch rolling, nixpkgs unstable

πŸ’– IP_ROUTER_ALERT β€” the "gimme ALL the packets bestie" sockopt ✨

okay so this is a page from the Linux man-pages, and it lives in section 2const (that's the little corner of the man pages where all the constant-ish socket option values hang out). It's IP_ROUTER_ALERT, and honestly? She's niche, she's specific, she's doing her little job. Let's get into it 🫢


πŸ“š LIBRARY

Standard C library β€” that's libc, aka -lc. The classic. The blueprint. The one everyone links against πŸ’…


✨ SYNOPSIS

#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>

int setsockopt(int sockfd, IPPROTO_IP, IP_ROUTER_ALERT,
               const int *enable, sizeof(int));

So you're calling setsockopt(2), you're passing IPPROTO_IP as the level, IP_ROUTER_ALERT as the option name, and a pointer to an int named enable with sizeof(int) as the length. Clean. Simple. Iconic. 🌟


🌸 DESCRIPTION

Pass all to-be forwarded packets with the IP Router Alert option set to this socket. Like, all of them. To this socket. She's collecting them πŸŽ€

Valid only for raw sockets. No, fr fr, raw sockets only β€” don't try to pull this anywhere else, bestie, it's not gonna work out.

This is useful, for instance, for user-space RSVP daemons. Yep, that's the main character use case right there πŸ‘‘


😭 ERRORS

That's it, that's the whole list β€” go check those, they've got the receipts 🧾


🌈 STANDARDS

Linux. Just Linux. That's the vibe. No POSIX, no nothing else β€” she's a Linux girlie πŸ’œ


πŸ¦‹ HISTORY

Linux 2.2. Old money. Vintage. Still slaying ✨


⚠️ CAVEATS

Not me telling you the tapped packets are not forwarded by the kernel 😭 It is the user's responsibility to send them out again. You catch 'em, you throw 'em. That's the deal.

Also, and this is important: socket binding is ignored β€” such packets are filtered only by protocol. So don't go thinking your bind is doing anything here, because it is not. She's not even looking at it πŸ™ˆ


πŸ‘€ SEE ALSO


πŸ’– okay that's the whole page, you ate that fr fr

Brought to you by Linux man-pages 6.20, dated 2025-11-25 β€” and yes, the IP_ROUTER_ALERT(2const) page name is real, section and all πŸ’…

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms