Author: tuexen
Date: Wed Apr 26 19:26:40 2017
New Revision: 317457
URL: https://svnweb.freebsd.org/changeset/base/317457

Log:
  Use consistently uint32_t for mtu values.
  
  This does not change functionality, but this cleanup is need for further
  improvements of ICMP handling.
  
  MFC after:    1 week

Modified:
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctp_var.h
  head/sys/netinet/sctputil.c
  head/sys/netinet6/sctp6_usrreq.c
  head/sys/netinet6/sctp6_var.h

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c      Wed Apr 26 19:25:01 2017        
(r317456)
+++ head/sys/netinet/sctp_usrreq.c      Wed Apr 26 19:26:40 2017        
(r317457)
@@ -152,7 +152,7 @@ sctp_notify(struct sctp_inpcb *inp,
     uint8_t icmp_type,
     uint8_t icmp_code,
     uint16_t ip_len,
-    uint16_t next_mtu)
+    uint32_t next_mtu)
 {
 #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
        struct socket *so;
@@ -328,7 +328,7 @@ sctp_ctlinput(int cmd, struct sockaddr *
                            icmp->icmp_type,
                            icmp->icmp_code,
                            ntohs(inner_ip->ip_len),
-                           ntohs(icmp->icmp_nextmtu));
+                           (uint32_t)ntohs(icmp->icmp_nextmtu));
                } else {
                        if ((stcb == NULL) && (inp != NULL)) {
                                /* reduce ref-count */

Modified: head/sys/netinet/sctp_var.h
==============================================================================
--- head/sys/netinet/sctp_var.h Wed Apr 26 19:25:01 2017        (r317456)
+++ head/sys/netinet/sctp_var.h Wed Apr 26 19:26:40 2017        (r317457)
@@ -341,7 +341,7 @@ void sctp_drain(void);
 void sctp_init(void);
 void 
 sctp_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *,
-    uint8_t, uint8_t, uint16_t, uint16_t);
+    uint8_t, uint8_t, uint16_t, uint32_t);
 int sctp_flush(struct socket *, int);
 int sctp_shutdown(struct socket *);
 int 

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c Wed Apr 26 19:25:01 2017        (r317456)
+++ head/sys/netinet/sctputil.c Wed Apr 26 19:26:40 2017        (r317457)
@@ -6971,7 +6971,7 @@ sctp_recv_icmp_tunneled_packet(int cmd, 
                }
                sctp_notify(inp, stcb, net, type, code,
                    ntohs(inner_ip->ip_len),
-                   ntohs(icmp->icmp_nextmtu));
+                   (uint32_t)ntohs(icmp->icmp_nextmtu));
        } else {
                if ((stcb == NULL) && (inp != NULL)) {
                        /* reduce ref-count */
@@ -7113,7 +7113,7 @@ sctp_recv_icmp6_tunneled_packet(int cmd,
                        code = ICMP6_PARAMPROB_NEXTHEADER;
                }
                sctp6_notify(inp, stcb, net, type, code,
-                   (uint16_t)ntohl(ip6cp->ip6c_icmp6->icmp6_mtu));
+                   ntohl(ip6cp->ip6c_icmp6->icmp6_mtu));
        } else {
                if ((stcb == NULL) && (inp != NULL)) {
                        /* reduce inp's ref-count */

Modified: head/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- head/sys/netinet6/sctp6_usrreq.c    Wed Apr 26 19:25:01 2017        
(r317456)
+++ head/sys/netinet6/sctp6_usrreq.c    Wed Apr 26 19:26:40 2017        
(r317457)
@@ -183,7 +183,7 @@ sctp6_notify(struct sctp_inpcb *inp,
     struct sctp_nets *net,
     uint8_t icmp6_type,
     uint8_t icmp6_code,
-    uint16_t next_mtu)
+    uint32_t next_mtu)
 {
 #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
        struct socket *so;
@@ -383,7 +383,7 @@ sctp6_ctlinput(int cmd, struct sockaddr 
                        sctp6_notify(inp, stcb, net,
                            ip6cp->ip6c_icmp6->icmp6_type,
                            ip6cp->ip6c_icmp6->icmp6_code,
-                           (uint16_t)ntohl(ip6cp->ip6c_icmp6->icmp6_mtu));
+                           ntohl(ip6cp->ip6c_icmp6->icmp6_mtu));
                } else {
                        if ((stcb == NULL) && (inp != NULL)) {
                                /* reduce inp's ref-count */

Modified: head/sys/netinet6/sctp6_var.h
==============================================================================
--- head/sys/netinet6/sctp6_var.h       Wed Apr 26 19:25:01 2017        
(r317456)
+++ head/sys/netinet6/sctp6_var.h       Wed Apr 26 19:26:40 2017        
(r317457)
@@ -49,6 +49,6 @@ sctp6_output(struct sctp_inpcb *, struct
 void sctp6_ctlinput(int, struct sockaddr *, void *);
 void 
 sctp6_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *,
-    uint8_t, uint8_t, uint16_t);
+    uint8_t, uint8_t, uint32_t);
 #endif
 #endif
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to