Skip to content

Commit

Permalink
pptp: fix byte order warnings
Browse files Browse the repository at this point in the history
Pptp driver has lots of byte order warnings from sparse.
This was because the on-the-wire header is in network byte order (obviously)
but the definition did not reflect that.

Also, the address structure to user space actually put the call id
in host order. Rather than break ABI compatibility, just acknowledge
the existing design.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Aug 13, 2013
1 parent 072017b commit ebd8b93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ppp/pptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ static const struct proto_ops pptp_ops;
struct pptp_gre_header {
u8 flags;
u8 ver;
u16 protocol;
u16 payload_len;
u16 call_id;
u32 seq;
u32 ack;
__be16 protocol;
__be16 payload_len;
__be16 call_id;
__be32 seq;
__be32 ack;
} __packed;

static struct pppox_sock *lookup_chan(u16 call_id, __be32 s_addr)
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/linux/if_pppox.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct pppoe_addr {
* PPTP addressing definition
*/
struct pptp_addr {
__be16 call_id;
__u16 call_id;
struct in_addr sin_addr;
};

Expand Down

0 comments on commit ebd8b93

Please sign in to comment.