diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-15 23:48:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-15 23:48:28 -0500 |
commit | d78c68efa84ff312f3663dbf921b1e3485232205 (patch) | |
tree | e2c6e640d747bdd815ce3795f6c37f8f4ca1161d /net | |
parent | 16c0f9362433a76f01d174bb8b9c87b9a96198ee (diff) | |
parent | aa0adb1a85e159cf57f0e11282bc6c9e3606a5f3 (diff) |
Merge branch 'for-david' of git://git.open-mesh.org/ecsv/linux-merge
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/main.h | 6 | ||||
-rw-r--r-- | net/batman-adv/packet.h | 14 | ||||
-rw-r--r-- | net/batman-adv/types.h | 4 | ||||
-rw-r--r-- | net/batman-adv/unicast.c | 6 |
4 files changed, 16 insertions, 14 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index d4d9926c2201..65106fb61b8f 100644 --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h | |||
@@ -151,9 +151,9 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...); | |||
151 | } \ | 151 | } \ |
152 | while (0) | 152 | while (0) |
153 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ | 153 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ |
154 | static inline void bat_dbg(char type __attribute__((unused)), | 154 | static inline void bat_dbg(char type __always_unused, |
155 | struct bat_priv *bat_priv __attribute__((unused)), | 155 | struct bat_priv *bat_priv __always_unused, |
156 | char *fmt __attribute__((unused)), ...) | 156 | char *fmt __always_unused, ...) |
157 | { | 157 | { |
158 | } | 158 | } |
159 | #endif | 159 | #endif |
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index b49fdf70a6d5..2284e8129cb2 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h | |||
@@ -63,7 +63,7 @@ struct batman_packet { | |||
63 | uint8_t num_hna; | 63 | uint8_t num_hna; |
64 | uint8_t gw_flags; /* flags related to gateway class */ | 64 | uint8_t gw_flags; /* flags related to gateway class */ |
65 | uint8_t align; | 65 | uint8_t align; |
66 | } __attribute__((packed)); | 66 | } __packed; |
67 | 67 | ||
68 | #define BAT_PACKET_LEN sizeof(struct batman_packet) | 68 | #define BAT_PACKET_LEN sizeof(struct batman_packet) |
69 | 69 | ||
@@ -76,7 +76,7 @@ struct icmp_packet { | |||
76 | uint8_t orig[6]; | 76 | uint8_t orig[6]; |
77 | uint16_t seqno; | 77 | uint16_t seqno; |
78 | uint8_t uid; | 78 | uint8_t uid; |
79 | } __attribute__((packed)); | 79 | } __packed; |
80 | 80 | ||
81 | #define BAT_RR_LEN 16 | 81 | #define BAT_RR_LEN 16 |
82 | 82 | ||
@@ -93,14 +93,14 @@ struct icmp_packet_rr { | |||
93 | uint8_t uid; | 93 | uint8_t uid; |
94 | uint8_t rr_cur; | 94 | uint8_t rr_cur; |
95 | uint8_t rr[BAT_RR_LEN][ETH_ALEN]; | 95 | uint8_t rr[BAT_RR_LEN][ETH_ALEN]; |
96 | } __attribute__((packed)); | 96 | } __packed; |
97 | 97 | ||
98 | struct unicast_packet { | 98 | struct unicast_packet { |
99 | uint8_t packet_type; | 99 | uint8_t packet_type; |
100 | uint8_t version; /* batman version field */ | 100 | uint8_t version; /* batman version field */ |
101 | uint8_t dest[6]; | 101 | uint8_t dest[6]; |
102 | uint8_t ttl; | 102 | uint8_t ttl; |
103 | } __attribute__((packed)); | 103 | } __packed; |
104 | 104 | ||
105 | struct unicast_frag_packet { | 105 | struct unicast_frag_packet { |
106 | uint8_t packet_type; | 106 | uint8_t packet_type; |
@@ -110,7 +110,7 @@ struct unicast_frag_packet { | |||
110 | uint8_t flags; | 110 | uint8_t flags; |
111 | uint8_t orig[6]; | 111 | uint8_t orig[6]; |
112 | uint16_t seqno; | 112 | uint16_t seqno; |
113 | } __attribute__((packed)); | 113 | } __packed; |
114 | 114 | ||
115 | struct bcast_packet { | 115 | struct bcast_packet { |
116 | uint8_t packet_type; | 116 | uint8_t packet_type; |
@@ -118,7 +118,7 @@ struct bcast_packet { | |||
118 | uint8_t orig[6]; | 118 | uint8_t orig[6]; |
119 | uint8_t ttl; | 119 | uint8_t ttl; |
120 | uint32_t seqno; | 120 | uint32_t seqno; |
121 | } __attribute__((packed)); | 121 | } __packed; |
122 | 122 | ||
123 | struct vis_packet { | 123 | struct vis_packet { |
124 | uint8_t packet_type; | 124 | uint8_t packet_type; |
@@ -131,6 +131,6 @@ struct vis_packet { | |||
131 | * neighbors */ | 131 | * neighbors */ |
132 | uint8_t target_orig[6]; /* who should receive this packet */ | 132 | uint8_t target_orig[6]; /* who should receive this packet */ |
133 | uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */ | 133 | uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */ |
134 | } __attribute__((packed)); | 134 | } __packed; |
135 | 135 | ||
136 | #endif /* _NET_BATMAN_ADV_PACKET_H_ */ | 136 | #endif /* _NET_BATMAN_ADV_PACKET_H_ */ |
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 97cb23dd3e69..bf3f6f5a12c4 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h | |||
@@ -246,13 +246,13 @@ struct vis_info { | |||
246 | /* this packet might be part of the vis send queue. */ | 246 | /* this packet might be part of the vis send queue. */ |
247 | struct sk_buff *skb_packet; | 247 | struct sk_buff *skb_packet; |
248 | /* vis_info may follow here*/ | 248 | /* vis_info may follow here*/ |
249 | } __attribute__((packed)); | 249 | } __packed; |
250 | 250 | ||
251 | struct vis_info_entry { | 251 | struct vis_info_entry { |
252 | uint8_t src[ETH_ALEN]; | 252 | uint8_t src[ETH_ALEN]; |
253 | uint8_t dest[ETH_ALEN]; | 253 | uint8_t dest[ETH_ALEN]; |
254 | uint8_t quality; /* quality = 0 means HNA */ | 254 | uint8_t quality; /* quality = 0 means HNA */ |
255 | } __attribute__((packed)); | 255 | } __packed; |
256 | 256 | ||
257 | struct recvlist_node { | 257 | struct recvlist_node { |
258 | struct list_head list; | 258 | struct list_head list; |
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index dc2e28bed844..ee41fef04b21 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
@@ -229,10 +229,12 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | |||
229 | if (!bat_priv->primary_if) | 229 | if (!bat_priv->primary_if) |
230 | goto dropped; | 230 | goto dropped; |
231 | 231 | ||
232 | unicast_packet = (struct unicast_packet *) skb->data; | 232 | frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len); |
233 | if (!frag_skb) | ||
234 | goto dropped; | ||
233 | 235 | ||
236 | unicast_packet = (struct unicast_packet *) skb->data; | ||
234 | memcpy(&tmp_uc, unicast_packet, uc_hdr_len); | 237 | memcpy(&tmp_uc, unicast_packet, uc_hdr_len); |
235 | frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len); | ||
236 | skb_split(skb, frag_skb, data_len / 2); | 238 | skb_split(skb, frag_skb, data_len / 2); |
237 | 239 | ||
238 | if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 || | 240 | if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 || |