diff options
Diffstat (limited to 'net/llc/llc_station.c')
-rw-r--r-- | net/llc/llc_station.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 6f2ea2090322..83da13339490 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c | |||
@@ -253,13 +253,14 @@ static int llc_station_ac_inc_xid_r_cnt_by_1(struct sk_buff *skb) | |||
253 | static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) | 253 | static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) |
254 | { | 254 | { |
255 | int rc = 1; | 255 | int rc = 1; |
256 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev); | 256 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
257 | sizeof(struct llc_xid_info)); | ||
257 | 258 | ||
258 | if (!nskb) | 259 | if (!nskb) |
259 | goto out; | 260 | goto out; |
260 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); | 261 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); |
261 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); | 262 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); |
262 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, llc_station_mac_sa); | 263 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, skb->dev->dev_addr); |
263 | if (unlikely(rc)) | 264 | if (unlikely(rc)) |
264 | goto free; | 265 | goto free; |
265 | llc_station_send_pdu(nskb); | 266 | llc_station_send_pdu(nskb); |
@@ -274,7 +275,8 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb) | |||
274 | { | 275 | { |
275 | u8 mac_da[ETH_ALEN], dsap; | 276 | u8 mac_da[ETH_ALEN], dsap; |
276 | int rc = 1; | 277 | int rc = 1; |
277 | struct sk_buff* nskb = llc_alloc_frame(NULL, skb->dev); | 278 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
279 | sizeof(struct llc_xid_info)); | ||
278 | 280 | ||
279 | if (!nskb) | 281 | if (!nskb) |
280 | goto out; | 282 | goto out; |
@@ -283,7 +285,7 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb) | |||
283 | llc_pdu_decode_ssap(skb, &dsap); | 285 | llc_pdu_decode_ssap(skb, &dsap); |
284 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 286 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
285 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); | 287 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); |
286 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 288 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); |
287 | if (unlikely(rc)) | 289 | if (unlikely(rc)) |
288 | goto free; | 290 | goto free; |
289 | llc_station_send_pdu(nskb); | 291 | llc_station_send_pdu(nskb); |
@@ -298,7 +300,12 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) | |||
298 | { | 300 | { |
299 | u8 mac_da[ETH_ALEN], dsap; | 301 | u8 mac_da[ETH_ALEN], dsap; |
300 | int rc = 1; | 302 | int rc = 1; |
301 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev); | 303 | u32 data_size; |
304 | struct sk_buff *nskb; | ||
305 | |||
306 | /* The test request command is type U (llc_len = 3) */ | ||
307 | data_size = ntohs(eth_hdr(skb)->h_proto) - 3; | ||
308 | nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); | ||
302 | 309 | ||
303 | if (!nskb) | 310 | if (!nskb) |
304 | goto out; | 311 | goto out; |
@@ -307,7 +314,7 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) | |||
307 | llc_pdu_decode_ssap(skb, &dsap); | 314 | llc_pdu_decode_ssap(skb, &dsap); |
308 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 315 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
309 | llc_pdu_init_as_test_rsp(nskb, skb); | 316 | llc_pdu_init_as_test_rsp(nskb, skb); |
310 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 317 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); |
311 | if (unlikely(rc)) | 318 | if (unlikely(rc)) |
312 | goto free; | 319 | goto free; |
313 | llc_station_send_pdu(nskb); | 320 | llc_station_send_pdu(nskb); |