diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2011-07-04 16:29:36 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2011-07-04 16:29:36 +0000 |
commit | 6c9d4597b187bccba0dc7a8a7b51a8e4d5803f38 (patch) | |
tree | 54419fc909419eab3e88e49bfd43a6a90153c954 /usr.sbin | |
parent | eabb2574d0e01f431aedde0ab6318074d7fab528 (diff) |
Bring back byte-order conversion that was inadvertently removed in previous
commit. Problem reported by Scott McEachern, ok yasuoka@
Diffstat (limited to 'usr.sbin')
-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); + } +} |