git: udp: Port FreeBSD's IPPROTO_IP/IP_SENDSRCADDR.

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Thu Nov 26 07:58:08 PST 2020


commit 14886acaff63ab197e5b032b5d10b027fc881d5f
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Thu Nov 26 11:22:10 2020 +0800

    udp: Port FreeBSD's IPPROTO_IP/IP_SENDSRCADDR.
    
    Minor difference:
    - Multicast src is not allowed.
    - Always allow src, if it is same as inp_laddr and is not multicast.
    
    While I'm here, fix datagram sending for multicast bound and connected
    UDP socket.

Summary of changes:
 sys/kern/uipc_socket.c                      |  13 +-
 sys/netinet/in.h                            |   1 +
 sys/netinet/in_pcb.c                        |  75 ++++++++++-
 sys/netinet/in_pcb.h                        |   2 +
 sys/netinet/udp_usrreq.c                    | 100 +++++++++++++-
 test/udp/{bindsend => sendsrcaddr}/Makefile |   2 +-
 test/udp/sendsrcaddr/udp_sendsrcaddr.c      | 196 ++++++++++++++++++++++++++++
 7 files changed, 373 insertions(+), 16 deletions(-)
 copy test/udp/{bindsend => sendsrcaddr}/Makefile (75%)
 create mode 100644 test/udp/sendsrcaddr/udp_sendsrcaddr.c

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/14886acaff63ab197e5b032b5d10b027fc881d5f


-- 
DragonFly BSD source repository


More information about the Commits mailing list