summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-06-01 13:57:24 +0000
committerMartin Mares <mj@ucw.cz>1999-06-01 13:57:24 +0000
commit3e1f30610e109b3eff7e3d8b420c4b7988bd3152 (patch)
treef596787bb62fc442b234026fb7c0f337d18163f1
parent9de840bdbd59669a129f68f1ff3595b34439ec09 (diff)
Defined IP_PREC_INTERNET_CONTROL and made all (well, both :)) protocols
use it when creating sockets.
-rw-r--r--lib/ipv4.h2
-rw-r--r--proto/ospf/ospf.c2
-rw-r--r--proto/ospf/ospf.h1
-rw-r--r--proto/rip/rip.c1
4 files changed, 4 insertions, 2 deletions
diff --git a/lib/ipv4.h b/lib/ipv4.h
index 87e08742..5cb2835e 100644
--- a/lib/ipv4.h
+++ b/lib/ipv4.h
@@ -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
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 2836561f..47c87f88 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -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;
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index 9d45993e..19c9eeb1 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -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
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index a3ddf615..a2457b79 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -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;