mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-12 22:39:57 +01:00
Defined IP_PREC_INTERNET_CONTROL and made all (well, both :)) protocols
use it when creating sockets.
This commit is contained in:
parent
9de840bdbd
commit
3e1f30610e
@ -77,4 +77,6 @@ static inline int ipv4_compare(u32 x, u32 y)
|
||||
return (x > y) - (x < y);
|
||||
}
|
||||
|
||||
#define IP_PREC_INTERNET_CONTROL 0xc0
|
||||
|
||||
#endif
|
||||
|
@ -229,7 +229,7 @@ ospf_open_socket(struct proto *p, struct ospf_iface *ifa)
|
||||
mcsk->dport=OSPF_PROTO;
|
||||
mcsk->saddr=AllSPFRouters;
|
||||
mcsk->daddr=AllSPFRouters;
|
||||
mcsk->tos=OSPF_IP_PRI;
|
||||
mcsk->tos=IP_PREC_INTERNET_CONTROL;
|
||||
mcsk->ttl=1;
|
||||
mcsk->rx_hook=ospf_rx_hook;
|
||||
mcsk->tx_hook=ospf_tx_hook;
|
||||
|
@ -12,7 +12,6 @@
|
||||
#define OSPF_PROTO 89
|
||||
#ifndef IPV6
|
||||
#define OSPF_VERSION 2
|
||||
#define OSPF_IP_PRI 0xc0
|
||||
#define AllSPFRouters ipa_from_u32(0xe0000005) /* 224.0.0.5 */
|
||||
#define AllDRouters ipa_from_u32(0xe0000006) /* 224.0.0.6 */
|
||||
#else
|
||||
|
@ -488,6 +488,7 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_
|
||||
rif->sock->daddr = IPA_NONE;
|
||||
rif->sock->dport = P_CF->port;
|
||||
rif->sock->ttl = 1; /* FIXME: care must be taken not to send requested responses from this socket */
|
||||
rif->sock->tos = IP_PREC_INTERNET_CONTROL;
|
||||
|
||||
if (flags & IF_BROADCAST)
|
||||
rif->sock->daddr = new->addr->brd;
|
||||
|
Loading…
Reference in New Issue
Block a user