diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-09 12:37:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-09 12:37:18 -0500 |
commit | 76a2f047880c2c7779f8950c50ee8f3855a5e6df (patch) | |
tree | a491d075e353b1ed01b069cca4963b21085d818e /net | |
parent | 97bee8e25da4dfc3b7a369fb2c2f280f5c1918c2 (diff) | |
parent | cb48cfe8079ddda78425a16d6c1be57d822b365b (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[TCP]: Fix iov_len calculation in tcp_v4_send_ack().
[NETFILTER]: nf_conntrack_netbios_ns: fix uninitialized member in expectation
[TG3]: Add PHY workaround for 5755M.
[BNX2]: Update version and reldate.
[BNX2]: Fix bug in bnx2_nvram_write().
[BNX2]: Fix 5709 Serdes detection.
[BNX2]: Don't apply CRC PHY workaround to 5709.
NetLabel: correct CIPSO tag handling when adding new DOI definitions
NetLabel: correct locking in selinux_netlbl_socket_setsid()
[Bluetooth] Correct SCO buffer for Broadcom based Dell laptops
[Bluetooth] Correct SCO buffer for Broadcom based HP laptops
[Bluetooth] Correct SCO buffer size for another ThinkPad laptop
[Bluetooth] Handle device registration failures
[Bluetooth] Fix uninitialized return value for RFCOMM sendmsg()
[Bluetooth] More checks if DLC is still attached to the TTY
[Bluetooth] Add packet size checks for CAPI messages
[X25]: Trivial, SOCK_DEBUG's in x25_facilities missing newlines
[INET]: Fix incorrect "inet_sock->is_icsk" assignment.
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/cmtp/capi.c | 39 | ||||
-rw-r--r-- | net/bluetooth/hci_sysfs.c | 7 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 9 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/tty.c | 22 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netbios_ns.c | 1 | ||||
-rw-r--r-- | net/netlabel/netlabel_cipso_v4.c | 6 | ||||
-rw-r--r-- | net/x25/x25_facilities.c | 12 |
10 files changed, 73 insertions, 29 deletions
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c index be04e9fb11f6..ab166b48ce8d 100644 --- a/net/bluetooth/cmtp/capi.c +++ b/net/bluetooth/cmtp/capi.c | |||
@@ -196,6 +196,9 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s | |||
196 | 196 | ||
197 | switch (CAPIMSG_SUBCOMMAND(skb->data)) { | 197 | switch (CAPIMSG_SUBCOMMAND(skb->data)) { |
198 | case CAPI_CONF: | 198 | case CAPI_CONF: |
199 | if (skb->len < CAPI_MSG_BASELEN + 10) | ||
200 | break; | ||
201 | |||
199 | func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 5); | 202 | func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 5); |
200 | info = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 8); | 203 | info = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 8); |
201 | 204 | ||
@@ -226,6 +229,9 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s | |||
226 | break; | 229 | break; |
227 | 230 | ||
228 | case CAPI_FUNCTION_GET_PROFILE: | 231 | case CAPI_FUNCTION_GET_PROFILE: |
232 | if (skb->len < CAPI_MSG_BASELEN + 11 + sizeof(capi_profile)) | ||
233 | break; | ||
234 | |||
229 | controller = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 11); | 235 | controller = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 11); |
230 | msgnum = CAPIMSG_MSGID(skb->data); | 236 | msgnum = CAPIMSG_MSGID(skb->data); |
231 | 237 | ||
@@ -246,17 +252,26 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s | |||
246 | break; | 252 | break; |
247 | 253 | ||
248 | case CAPI_FUNCTION_GET_MANUFACTURER: | 254 | case CAPI_FUNCTION_GET_MANUFACTURER: |
255 | if (skb->len < CAPI_MSG_BASELEN + 15) | ||
256 | break; | ||
257 | |||
249 | controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 10); | 258 | controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 10); |
250 | 259 | ||
251 | if (!info && ctrl) { | 260 | if (!info && ctrl) { |
261 | int len = min_t(uint, CAPI_MANUFACTURER_LEN, | ||
262 | skb->data[CAPI_MSG_BASELEN + 14]); | ||
263 | |||
264 | memset(ctrl->manu, 0, CAPI_MANUFACTURER_LEN); | ||
252 | strncpy(ctrl->manu, | 265 | strncpy(ctrl->manu, |
253 | skb->data + CAPI_MSG_BASELEN + 15, | 266 | skb->data + CAPI_MSG_BASELEN + 15, len); |
254 | skb->data[CAPI_MSG_BASELEN + 14]); | ||
255 | } | 267 | } |
256 | 268 | ||
257 | break; | 269 | break; |
258 | 270 | ||
259 | case CAPI_FUNCTION_GET_VERSION: | 271 | case CAPI_FUNCTION_GET_VERSION: |
272 | if (skb->len < CAPI_MSG_BASELEN + 32) | ||
273 | break; | ||
274 | |||
260 | controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12); | 275 | controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12); |
261 | 276 | ||
262 | if (!info && ctrl) { | 277 | if (!info && ctrl) { |
@@ -269,13 +284,18 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s | |||
269 | break; | 284 | break; |
270 | 285 | ||
271 | case CAPI_FUNCTION_GET_SERIAL_NUMBER: | 286 | case CAPI_FUNCTION_GET_SERIAL_NUMBER: |
287 | if (skb->len < CAPI_MSG_BASELEN + 17) | ||
288 | break; | ||
289 | |||
272 | controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12); | 290 | controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12); |
273 | 291 | ||
274 | if (!info && ctrl) { | 292 | if (!info && ctrl) { |
293 | int len = min_t(uint, CAPI_SERIAL_LEN, | ||
294 | skb->data[CAPI_MSG_BASELEN + 16]); | ||
295 | |||
275 | memset(ctrl->serial, 0, CAPI_SERIAL_LEN); | 296 | memset(ctrl->serial, 0, CAPI_SERIAL_LEN); |
276 | strncpy(ctrl->serial, | 297 | strncpy(ctrl->serial, |
277 | skb->data + CAPI_MSG_BASELEN + 17, | 298 | skb->data + CAPI_MSG_BASELEN + 17, len); |
278 | skb->data[CAPI_MSG_BASELEN + 16]); | ||
279 | } | 299 | } |
280 | 300 | ||
281 | break; | 301 | break; |
@@ -284,14 +304,18 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s | |||
284 | break; | 304 | break; |
285 | 305 | ||
286 | case CAPI_IND: | 306 | case CAPI_IND: |
307 | if (skb->len < CAPI_MSG_BASELEN + 6) | ||
308 | break; | ||
309 | |||
287 | func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 3); | 310 | func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 3); |
288 | 311 | ||
289 | if (func == CAPI_FUNCTION_LOOPBACK) { | 312 | if (func == CAPI_FUNCTION_LOOPBACK) { |
313 | int len = min_t(uint, skb->len - CAPI_MSG_BASELEN - 6, | ||
314 | skb->data[CAPI_MSG_BASELEN + 5]); | ||
290 | appl = CAPIMSG_APPID(skb->data); | 315 | appl = CAPIMSG_APPID(skb->data); |
291 | msgnum = CAPIMSG_MSGID(skb->data); | 316 | msgnum = CAPIMSG_MSGID(skb->data); |
292 | cmtp_send_interopmsg(session, CAPI_RESP, appl, msgnum, func, | 317 | cmtp_send_interopmsg(session, CAPI_RESP, appl, msgnum, func, |
293 | skb->data + CAPI_MSG_BASELEN + 6, | 318 | skb->data + CAPI_MSG_BASELEN + 6, len); |
294 | skb->data[CAPI_MSG_BASELEN + 5]); | ||
295 | } | 319 | } |
296 | 320 | ||
297 | break; | 321 | break; |
@@ -309,6 +333,9 @@ void cmtp_recv_capimsg(struct cmtp_session *session, struct sk_buff *skb) | |||
309 | 333 | ||
310 | BT_DBG("session %p skb %p len %d", session, skb, skb->len); | 334 | BT_DBG("session %p skb %p len %d", session, skb, skb->len); |
311 | 335 | ||
336 | if (skb->len < CAPI_MSG_BASELEN) | ||
337 | return; | ||
338 | |||
312 | if (CAPIMSG_COMMAND(skb->data) == CAPI_INTEROPERABILITY) { | 339 | if (CAPIMSG_COMMAND(skb->data) == CAPI_INTEROPERABILITY) { |
313 | cmtp_recv_interopmsg(session, skb); | 340 | cmtp_recv_interopmsg(session, skb); |
314 | return; | 341 | return; |
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index d4c935692ccf..801d687ea4ef 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
@@ -242,7 +242,7 @@ static void add_conn(struct work_struct *work) | |||
242 | struct hci_conn *conn = container_of(work, struct hci_conn, work); | 242 | struct hci_conn *conn = container_of(work, struct hci_conn, work); |
243 | int i; | 243 | int i; |
244 | 244 | ||
245 | if (device_register(&conn->dev) < 0) { | 245 | if (device_add(&conn->dev) < 0) { |
246 | BT_ERR("Failed to register connection device"); | 246 | BT_ERR("Failed to register connection device"); |
247 | return; | 247 | return; |
248 | } | 248 | } |
@@ -272,6 +272,8 @@ void hci_conn_add_sysfs(struct hci_conn *conn) | |||
272 | 272 | ||
273 | dev_set_drvdata(&conn->dev, conn); | 273 | dev_set_drvdata(&conn->dev, conn); |
274 | 274 | ||
275 | device_initialize(&conn->dev); | ||
276 | |||
275 | INIT_WORK(&conn->work, add_conn); | 277 | INIT_WORK(&conn->work, add_conn); |
276 | 278 | ||
277 | schedule_work(&conn->work); | 279 | schedule_work(&conn->work); |
@@ -287,6 +289,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn) | |||
287 | { | 289 | { |
288 | BT_DBG("conn %p", conn); | 290 | BT_DBG("conn %p", conn); |
289 | 291 | ||
292 | if (!device_is_registered(&conn->dev)) | ||
293 | return; | ||
294 | |||
290 | INIT_WORK(&conn->work, del_conn); | 295 | INIT_WORK(&conn->work, del_conn); |
291 | 296 | ||
292 | schedule_work(&conn->work); | 297 | schedule_work(&conn->work); |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 544d65b7baa7..cb7e855f0828 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -557,7 +557,6 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
557 | struct sock *sk = sock->sk; | 557 | struct sock *sk = sock->sk; |
558 | struct rfcomm_dlc *d = rfcomm_pi(sk)->dlc; | 558 | struct rfcomm_dlc *d = rfcomm_pi(sk)->dlc; |
559 | struct sk_buff *skb; | 559 | struct sk_buff *skb; |
560 | int err; | ||
561 | int sent = 0; | 560 | int sent = 0; |
562 | 561 | ||
563 | if (msg->msg_flags & MSG_OOB) | 562 | if (msg->msg_flags & MSG_OOB) |
@@ -572,6 +571,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
572 | 571 | ||
573 | while (len) { | 572 | while (len) { |
574 | size_t size = min_t(size_t, len, d->mtu); | 573 | size_t size = min_t(size_t, len, d->mtu); |
574 | int err; | ||
575 | 575 | ||
576 | skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE, | 576 | skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE, |
577 | msg->msg_flags & MSG_DONTWAIT, &err); | 577 | msg->msg_flags & MSG_DONTWAIT, &err); |
@@ -582,13 +582,16 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
582 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 582 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); |
583 | if (err) { | 583 | if (err) { |
584 | kfree_skb(skb); | 584 | kfree_skb(skb); |
585 | sent = err; | 585 | if (sent == 0) |
586 | sent = err; | ||
586 | break; | 587 | break; |
587 | } | 588 | } |
588 | 589 | ||
589 | err = rfcomm_dlc_send(d, skb); | 590 | err = rfcomm_dlc_send(d, skb); |
590 | if (err < 0) { | 591 | if (err < 0) { |
591 | kfree_skb(skb); | 592 | kfree_skb(skb); |
593 | if (sent == 0) | ||
594 | sent = err; | ||
592 | break; | 595 | break; |
593 | } | 596 | } |
594 | 597 | ||
@@ -598,7 +601,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
598 | 601 | ||
599 | release_sock(sk); | 602 | release_sock(sk); |
600 | 603 | ||
601 | return sent ? sent : err; | 604 | return sent; |
602 | } | 605 | } |
603 | 606 | ||
604 | static long rfcomm_sock_data_wait(struct sock *sk, long timeo) | 607 | static long rfcomm_sock_data_wait(struct sock *sk, long timeo) |
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index e0e0d09023b2..eb2b52484c70 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -697,9 +697,13 @@ static int rfcomm_tty_write_room(struct tty_struct *tty) | |||
697 | 697 | ||
698 | BT_DBG("tty %p", tty); | 698 | BT_DBG("tty %p", tty); |
699 | 699 | ||
700 | if (!dev || !dev->dlc) | ||
701 | return 0; | ||
702 | |||
700 | room = rfcomm_room(dev->dlc) - atomic_read(&dev->wmem_alloc); | 703 | room = rfcomm_room(dev->dlc) - atomic_read(&dev->wmem_alloc); |
701 | if (room < 0) | 704 | if (room < 0) |
702 | room = 0; | 705 | room = 0; |
706 | |||
703 | return room; | 707 | return room; |
704 | } | 708 | } |
705 | 709 | ||
@@ -915,12 +919,14 @@ static void rfcomm_tty_unthrottle(struct tty_struct *tty) | |||
915 | static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty) | 919 | static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty) |
916 | { | 920 | { |
917 | struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; | 921 | struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; |
918 | struct rfcomm_dlc *dlc = dev->dlc; | ||
919 | 922 | ||
920 | BT_DBG("tty %p dev %p", tty, dev); | 923 | BT_DBG("tty %p dev %p", tty, dev); |
921 | 924 | ||
922 | if (!skb_queue_empty(&dlc->tx_queue)) | 925 | if (!dev || !dev->dlc) |
923 | return dlc->mtu; | 926 | return 0; |
927 | |||
928 | if (!skb_queue_empty(&dev->dlc->tx_queue)) | ||
929 | return dev->dlc->mtu; | ||
924 | 930 | ||
925 | return 0; | 931 | return 0; |
926 | } | 932 | } |
@@ -928,11 +934,12 @@ static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty) | |||
928 | static void rfcomm_tty_flush_buffer(struct tty_struct *tty) | 934 | static void rfcomm_tty_flush_buffer(struct tty_struct *tty) |
929 | { | 935 | { |
930 | struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; | 936 | struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; |
931 | if (!dev) | ||
932 | return; | ||
933 | 937 | ||
934 | BT_DBG("tty %p dev %p", tty, dev); | 938 | BT_DBG("tty %p dev %p", tty, dev); |
935 | 939 | ||
940 | if (!dev || !dev->dlc) | ||
941 | return; | ||
942 | |||
936 | skb_queue_purge(&dev->dlc->tx_queue); | 943 | skb_queue_purge(&dev->dlc->tx_queue); |
937 | 944 | ||
938 | if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup) | 945 | if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup) |
@@ -952,11 +959,12 @@ static void rfcomm_tty_wait_until_sent(struct tty_struct *tty, int timeout) | |||
952 | static void rfcomm_tty_hangup(struct tty_struct *tty) | 959 | static void rfcomm_tty_hangup(struct tty_struct *tty) |
953 | { | 960 | { |
954 | struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; | 961 | struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; |
955 | if (!dev) | ||
956 | return; | ||
957 | 962 | ||
958 | BT_DBG("tty %p dev %p", tty, dev); | 963 | BT_DBG("tty %p dev %p", tty, dev); |
959 | 964 | ||
965 | if (!dev) | ||
966 | return; | ||
967 | |||
960 | rfcomm_tty_flush_buffer(tty); | 968 | rfcomm_tty_flush_buffer(tty); |
961 | 969 | ||
962 | if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) | 970 | if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 1144900d37f6..d60fd7321e63 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -305,7 +305,7 @@ lookup_protocol: | |||
305 | sk->sk_reuse = 1; | 305 | sk->sk_reuse = 1; |
306 | 306 | ||
307 | inet = inet_sk(sk); | 307 | inet = inet_sk(sk); |
308 | inet->is_icsk = INET_PROTOSW_ICSK & answer_flags; | 308 | inet->is_icsk = (INET_PROTOSW_ICSK & answer_flags) == INET_PROTOSW_ICSK; |
309 | 309 | ||
310 | if (SOCK_RAW == sock->type) { | 310 | if (SOCK_RAW == sock->type) { |
311 | inet->num = protocol; | 311 | inet->num = protocol; |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index bf7a22412bcb..12de90a5047c 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -648,7 +648,7 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk, | |||
648 | TCPOLEN_TIMESTAMP); | 648 | TCPOLEN_TIMESTAMP); |
649 | rep.opt[1] = htonl(tcp_time_stamp); | 649 | rep.opt[1] = htonl(tcp_time_stamp); |
650 | rep.opt[2] = htonl(ts); | 650 | rep.opt[2] = htonl(ts); |
651 | arg.iov[0].iov_len = TCPOLEN_TSTAMP_ALIGNED; | 651 | arg.iov[0].iov_len += TCPOLEN_TSTAMP_ALIGNED; |
652 | } | 652 | } |
653 | 653 | ||
654 | /* Swap the send and the receive. */ | 654 | /* Swap the send and the receive. */ |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index e5cd83b2205d..832a5e6e2d7e 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -171,7 +171,7 @@ lookup_protocol: | |||
171 | sk->sk_reuse = 1; | 171 | sk->sk_reuse = 1; |
172 | 172 | ||
173 | inet = inet_sk(sk); | 173 | inet = inet_sk(sk); |
174 | inet->is_icsk = INET_PROTOSW_ICSK & answer_flags; | 174 | inet->is_icsk = (INET_PROTOSW_ICSK & answer_flags) == INET_PROTOSW_ICSK; |
175 | 175 | ||
176 | if (SOCK_RAW == sock->type) { | 176 | if (SOCK_RAW == sock->type) { |
177 | inet->num = protocol; | 177 | inet->num = protocol; |
diff --git a/net/netfilter/nf_conntrack_netbios_ns.c b/net/netfilter/nf_conntrack_netbios_ns.c index a5b234e444dc..2a48efdf0d67 100644 --- a/net/netfilter/nf_conntrack_netbios_ns.c +++ b/net/netfilter/nf_conntrack_netbios_ns.c | |||
@@ -89,6 +89,7 @@ static int help(struct sk_buff **pskb, unsigned int protoff, | |||
89 | 89 | ||
90 | exp->expectfn = NULL; | 90 | exp->expectfn = NULL; |
91 | exp->flags = NF_CT_EXPECT_PERMANENT; | 91 | exp->flags = NF_CT_EXPECT_PERMANENT; |
92 | exp->helper = NULL; | ||
92 | 93 | ||
93 | nf_conntrack_expect_related(exp); | 94 | nf_conntrack_expect_related(exp); |
94 | nf_conntrack_expect_put(exp); | 95 | nf_conntrack_expect_put(exp); |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index 4afc75f9e377..73e0ff469bff 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
@@ -130,12 +130,12 @@ static int netlbl_cipsov4_add_common(struct genl_info *info, | |||
130 | 130 | ||
131 | nla_for_each_nested(nla, info->attrs[NLBL_CIPSOV4_A_TAGLST], nla_rem) | 131 | nla_for_each_nested(nla, info->attrs[NLBL_CIPSOV4_A_TAGLST], nla_rem) |
132 | if (nla->nla_type == NLBL_CIPSOV4_A_TAG) { | 132 | if (nla->nla_type == NLBL_CIPSOV4_A_TAG) { |
133 | if (iter > CIPSO_V4_TAG_MAXCNT) | 133 | if (iter >= CIPSO_V4_TAG_MAXCNT) |
134 | return -EINVAL; | 134 | return -EINVAL; |
135 | doi_def->tags[iter++] = nla_get_u8(nla); | 135 | doi_def->tags[iter++] = nla_get_u8(nla); |
136 | } | 136 | } |
137 | if (iter < CIPSO_V4_TAG_MAXCNT) | 137 | while (iter < CIPSO_V4_TAG_MAXCNT) |
138 | doi_def->tags[iter] = CIPSO_V4_TAG_INVALID; | 138 | doi_def->tags[iter++] = CIPSO_V4_TAG_INVALID; |
139 | 139 | ||
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c index 9f42b9c9de37..27f5cc7966f6 100644 --- a/net/x25/x25_facilities.c +++ b/net/x25/x25_facilities.c | |||
@@ -254,7 +254,7 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, | |||
254 | * They want reverse charging, we won't accept it. | 254 | * They want reverse charging, we won't accept it. |
255 | */ | 255 | */ |
256 | if ((theirs.reverse & 0x01 ) && (ours->reverse & 0x01)) { | 256 | if ((theirs.reverse & 0x01 ) && (ours->reverse & 0x01)) { |
257 | SOCK_DEBUG(sk, "X.25: rejecting reverse charging request"); | 257 | SOCK_DEBUG(sk, "X.25: rejecting reverse charging request\n"); |
258 | return -1; | 258 | return -1; |
259 | } | 259 | } |
260 | 260 | ||
@@ -262,29 +262,29 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, | |||
262 | 262 | ||
263 | if (theirs.throughput) { | 263 | if (theirs.throughput) { |
264 | if (theirs.throughput < ours->throughput) { | 264 | if (theirs.throughput < ours->throughput) { |
265 | SOCK_DEBUG(sk, "X.25: throughput negotiated down"); | 265 | SOCK_DEBUG(sk, "X.25: throughput negotiated down\n"); |
266 | new->throughput = theirs.throughput; | 266 | new->throughput = theirs.throughput; |
267 | } | 267 | } |
268 | } | 268 | } |
269 | 269 | ||
270 | if (theirs.pacsize_in && theirs.pacsize_out) { | 270 | if (theirs.pacsize_in && theirs.pacsize_out) { |
271 | if (theirs.pacsize_in < ours->pacsize_in) { | 271 | if (theirs.pacsize_in < ours->pacsize_in) { |
272 | SOCK_DEBUG(sk, "X.25: packet size inwards negotiated down"); | 272 | SOCK_DEBUG(sk, "X.25: packet size inwards negotiated down\n"); |
273 | new->pacsize_in = theirs.pacsize_in; | 273 | new->pacsize_in = theirs.pacsize_in; |
274 | } | 274 | } |
275 | if (theirs.pacsize_out < ours->pacsize_out) { | 275 | if (theirs.pacsize_out < ours->pacsize_out) { |
276 | SOCK_DEBUG(sk, "X.25: packet size outwards negotiated down"); | 276 | SOCK_DEBUG(sk, "X.25: packet size outwards negotiated down\n"); |
277 | new->pacsize_out = theirs.pacsize_out; | 277 | new->pacsize_out = theirs.pacsize_out; |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | if (theirs.winsize_in && theirs.winsize_out) { | 281 | if (theirs.winsize_in && theirs.winsize_out) { |
282 | if (theirs.winsize_in < ours->winsize_in) { | 282 | if (theirs.winsize_in < ours->winsize_in) { |
283 | SOCK_DEBUG(sk, "X.25: window size inwards negotiated down"); | 283 | SOCK_DEBUG(sk, "X.25: window size inwards negotiated down\n"); |
284 | new->winsize_in = theirs.winsize_in; | 284 | new->winsize_in = theirs.winsize_in; |
285 | } | 285 | } |
286 | if (theirs.winsize_out < ours->winsize_out) { | 286 | if (theirs.winsize_out < ours->winsize_out) { |
287 | SOCK_DEBUG(sk, "X.25: window size outwards negotiated down"); | 287 | SOCK_DEBUG(sk, "X.25: window size outwards negotiated down\n"); |
288 | new->winsize_out = theirs.winsize_out; | 288 | new->winsize_out = theirs.winsize_out; |
289 | } | 289 | } |
290 | } | 290 | } |