diff options
author | 2011-07-04 16:29:35 +0000 | |
---|---|---|
committer | 2011-07-04 16:29:35 +0000 | |
commit | 9dbfb76f80f3060573c9528d1fe03585eeb0d862 (patch) | |
tree | 82d2da9ac9c605c7c5ab80fa5fc468a52103bb9e | |
parent | IPv4 packets with IP options get dropped and no state is created. (diff) | |
download | wireguard-openbsd-9dbfb76f80f3060573c9528d1fe03585eeb0d862.tar.xz wireguard-openbsd-9dbfb76f80f3060573c9528d1fe03585eeb0d862.zip |
Bring back byte-order conversion that was inadvertently removed in previous
commit. Problem reported by Scott McEachern, ok yasuoka@
-rw-r--r-- | usr.sbin/pppoe/client.c | 3 | ||||
-rw-r--r-- | usr.sbin/pppoe/pppoe.h | 3 | ||||
-rw-r--r-- | usr.sbin/pppoe/tag.c | 13 |
3 files changed, 16 insertions, 3 deletions
diff --git a/usr.sbin/pppoe/client.c b/usr.sbin/pppoe/client.c index 09730d955c3..032b6c3d242 100644 --- a/usr.sbin/pppoe/client.c +++ b/usr.sbin/pppoe/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.22 2011/03/31 09:19:35 sobrado Exp $ */ +/* $OpenBSD: client.c,v 1.23 2011/07/04 16:29:35 sthen Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -274,6 +274,7 @@ send_padr(int bfd, u_int8_t *srv, struct ether_addr *myea, } ph->len = htons(ph->len); + tag_hton(tl); client_state = STATE_EXPECT_PADS; return (writev(bfd, iov, idx)); diff --git a/usr.sbin/pppoe/pppoe.h b/usr.sbin/pppoe/pppoe.h index c18445c6b80..ddc1e1473af 100644 --- a/usr.sbin/pppoe/pppoe.h +++ b/usr.sbin/pppoe/pppoe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pppoe.h,v 1.8 2011/03/31 09:19:35 sobrado Exp $ */ +/* $OpenBSD: pppoe.h,v 1.9 2011/07/04 16:29:35 sthen Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -103,6 +103,7 @@ void tag_destroy(struct tag_list *); struct tag_node *tag_lookup(struct tag_list *, u_int16_t, int); int tag_add(struct tag_list *, u_int16_t, u_int16_t, u_int8_t *); int tag_pkt(struct tag_list *, u_long, u_int8_t *); +void tag_hton(struct tag_list *); struct pppoe_session { LIST_ENTRY(pppoe_session) s_next; diff --git a/usr.sbin/pppoe/tag.c b/usr.sbin/pppoe/tag.c index bf5e887ac2d..a690fff9d33 100644 --- a/usr.sbin/pppoe/tag.c +++ b/usr.sbin/pppoe/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.3 2011/03/31 09:19:35 sobrado Exp $ */ +/* $OpenBSD: tag.c,v 1.4 2011/07/04 16:29:35 sthen Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -143,3 +143,14 @@ tag_pkt(struct tag_list *l, u_long pktlen, u_int8_t *pkt) return (-1); return (0); } + +void +tag_hton(struct tag_list *l) +{ + struct tag_node *p; + + for (p = LIST_FIRST(&l->thelist); p; p = LIST_NEXT(p, next)) { + p->len = htons(p->len); + p->type = htons(p->type); + } +} |