diff options
author | Michele Marchetto <michele@cvs.openbsd.org> | 2009-02-03 16:44:16 +0000 |
---|---|---|
committer | Michele Marchetto <michele@cvs.openbsd.org> | 2009-02-03 16:44:16 +0000 |
commit | eaff2ea3212185b28f2b1e7d4ad7787569f51d0d (patch) | |
tree | f2ff78ee8c593cd28ef77acfe94be9c44341b371 | |
parent | 628b50697a8761bcac8e34d9ffdff103646d2ee5 (diff) |
Reflect MPLS kernel changes. Operations are stored now in rt_mpls field.
ok claudio@ laurent@
-rw-r--r-- | sbin/route/route.c | 12 | ||||
-rw-r--r-- | sbin/route/show.c | 4 | ||||
-rw-r--r-- | usr.bin/netstat/show.c | 4 |
3 files changed, 11 insertions, 9 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 892976550ec..bdc5e5e4c5f 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.126 2009/01/29 11:21:34 michele Exp $ */ +/* $OpenBSD: route.c,v 1.127 2009/02/03 16:44:15 michele Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -79,6 +79,7 @@ int rtm_addrs, s; int forcehost, forcenet, Fflag, nflag, af, qflag, tflag; int iflag, verbose, aflen = sizeof(struct sockaddr_in); int locking, lockrest, debugonly; +u_long mpls_flags = 0; u_long rtm_inits; uid_t uid; u_int tableid = 0; @@ -390,7 +391,7 @@ newroute(int argc, char **argv) errx(1, "-mplslabel requires " "-inet or -inet6"); getmplslabel(*++argv, 0); - flags |= MPLS_OP_PUSH; + mpls_flags = MPLS_OP_PUSH; break; case K_IN: if (!--argc) @@ -409,17 +410,17 @@ newroute(int argc, char **argv) case K_POP: if (af != AF_MPLS) errx(1, "-pop requires -mpls"); - flags |= MPLS_OP_POP; + mpls_flags = MPLS_OP_POP; break; case K_PUSH: if (af != AF_MPLS) errx(1, "-push requires -mpls"); - flags |= MPLS_OP_PUSH; + mpls_flags = MPLS_OP_PUSH; break; case K_SWAP: if (af != AF_MPLS) errx(1, "-swap requires -mpls"); - flags |= MPLS_OP_SWAP; + mpls_flags = MPLS_OP_SWAP; break; case K_IFACE: case K_INTERFACE: @@ -1054,6 +1055,7 @@ rtmsg(int cmd, int flags, int fmask, u_short prio) rtm.rtm_inits = rtm_inits; rtm.rtm_tableid = tableid; rtm.rtm_priority = prio; + rtm.rtm_mpls = mpls_flags; rtm.rtm_hdrlen = sizeof(rtm); if (rtm_addrs & RTA_NETMASK) diff --git a/sbin/route/show.c b/sbin/route/show.c index c46ffbf6a5b..f44db3a06d1 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.75 2009/01/26 17:18:47 claudio Exp $ */ +/* $OpenBSD: show.c,v 1.76 2009/02/03 16:44:15 michele Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -300,7 +300,7 @@ p_rtentry(struct rt_msghdr *rtm) return; p_sockaddr(sa, mask, rtm->rtm_flags, WID_DST(sa->sa_family)); - p_sockaddr_mpls(sa, rti_info[RTAX_SRC], rtm->rtm_flags, + p_sockaddr_mpls(sa, rti_info[RTAX_SRC], rtm->rtm_mpls, WID_DST(sa->sa_family)); p_sockaddr(rti_info[RTAX_GATEWAY], NULL, RTF_HOST, diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c index 36fc25f96a8..57ee669ac10 100644 --- a/usr.bin/netstat/show.c +++ b/usr.bin/netstat/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.18 2009/01/26 17:28:09 claudio Exp $ */ +/* $OpenBSD: show.c,v 1.19 2009/02/03 16:44:15 michele Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -297,7 +297,7 @@ p_rtentry(struct rt_msghdr *rtm) return; p_sockaddr(sa, mask, rtm->rtm_flags, WID_DST(sa->sa_family)); - p_sockaddr_mpls(sa, rti_info[RTAX_SRC], rtm->rtm_flags, + p_sockaddr_mpls(sa, rti_info[RTAX_SRC], rtm->rtm_mpls, WID_DST(sa->sa_family)); p_sockaddr(rti_info[RTAX_GATEWAY], NULL, RTF_HOST, |