Hello community, here is the log from the commit of package sysdig for openSUSE:Factory checked in at 2018-06-27 10:21:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sysdig (Old) and /work/SRC/openSUSE:Factory/.sysdig.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sysdig" Wed Jun 27 10:21:20 2018 rev:21 rq:618954 version:0.21.0 Changes: -------- --- /work/SRC/openSUSE:Factory/sysdig/sysdig.changes 2018-05-11 09:17:08.720971221 +0200 +++ /work/SRC/openSUSE:Factory/.sysdig.new/sysdig.changes 2018-06-27 10:21:25.416033007 +0200 @@ -1,0 +2,6 @@ +Mon Jun 25 11:59:35 UTC 2018 - joop.boo...@opensuse.org + +- Patch sysdig_proto_ops_getname.patch to fix build + - Seth Forshee : Update for proto_ops.getname() prototype changes in Linux 4.17 (#1114) + +------------------------------------------------------------------- New: ---- sysdig_proto_ops_getname.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sysdig.spec ++++++ --- /var/tmp/diff_new_pack.N18rF0/_old 2018-06-27 10:21:26.260002223 +0200 +++ /var/tmp/diff_new_pack.N18rF0/_new 2018-06-27 10:21:26.264002078 +0200 @@ -24,6 +24,8 @@ Group: System/Monitoring URL: http://www.sysdig.org/ Source0: https://github.com/draios/%{name}/archive/%{version}/sysdig-%{version}.tar.gz +# PATCH-FIX-UPSTREAM sysdig_proto_ops_getname.patch +Patch0: sysdig_proto_ops_getname.patch BuildRequires: %{kernel_module_package_buildreqs} BuildRequires: cmake BuildRequires: fdupes @@ -49,6 +51,7 @@ %prep %setup -q +%patch0 -p1 %build export SYSDIG_CHISEL_DIR=%{_datadir}%{name}/chisels ++++++ sysdig_proto_ops_getname.patch ++++++ commit e9eb55388257af3bee77fe4a92d094295f7e9920 Author: Seth Forshee <seth.fors...@canonical.com> Date: Tue Jun 12 16:03:20 2018 -0500 Update for proto_ops.getname() prototype changes in Linux 4.17 (#1114) Linux 4.17 removed the sockaddr_len argument and instead returns the length on success instead of returning 0. To cope, define an internal wrapper that uses the appropriate prototype based on kernel version. Since nothing uses the sockaddr make the wrapper return 0 on success or a negative error code so that surrounding code does not need to change. diff --git a/driver/ppm_events.c b/driver/ppm_events.c index db6f6165..24548070 100644 --- a/driver/ppm_events.c +++ b/driver/ppm_events.c @@ -174,6 +174,20 @@ int32_t dpi_lookahead_init(void) return PPM_SUCCESS; } +static int sock_getname(struct socket *sock, struct sockaddr *sockaddr, int peer) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) + int ret; + ret = sock->ops->getname(sock, sockaddr, peer); + if (ret > 0) + ret = 0; + return ret; +#else + int sockaddr_len; + return sock->ops->getname(sock, sockaddr, &sockaddr_len, peer); +#endif +} + inline u32 compute_snaplen(struct event_filler_arguments *args, char *buf, u32 lookahead_size) { u32 res = args->consumer->snaplen; @@ -182,7 +196,6 @@ inline u32 compute_snaplen(struct event_filler_arguments *args, char *buf, u32 l sa_family_t family; struct sockaddr_storage sock_address; struct sockaddr_storage peer_address; - int sock_address_len; int peer_address_len; u16 sport, dport; @@ -233,7 +246,7 @@ inline u32 compute_snaplen(struct event_filler_arguments *args, char *buf, u32 l if (sock) { if (sock->sk) { - err = sock->ops->getname(sock, (struct sockaddr *)&sock_address, &sock_address_len, 0); + err = sock_getname(sock, (struct sockaddr *)&sock_address, 0); if (err == 0) { if(args->event_type == PPME_SOCKET_SENDTO_X) @@ -254,7 +267,7 @@ inline u32 compute_snaplen(struct event_filler_arguments *args, char *buf, u32 l /* * Suppose is a connected socket, fall back to fd */ - err = sock->ops->getname(sock, (struct sockaddr *)&peer_address, &peer_address_len, 1); + err = sock_getname(sock, (struct sockaddr *)&peer_address, 1); } else { /* * Get the address len @@ -274,7 +287,7 @@ inline u32 compute_snaplen(struct event_filler_arguments *args, char *buf, u32 l /* * This case should be very rare, fallback again to sock */ - err = sock->ops->getname(sock, (struct sockaddr *)&peer_address, &peer_address_len, 1); + err = sock_getname(sock, (struct sockaddr *)&peer_address, 1); } } } else if (args->event_type == PPME_SOCKET_SENDMSG_X) { @@ -327,9 +340,9 @@ inline u32 compute_snaplen(struct event_filler_arguments *args, char *buf, u32 l /* * Suppose it is a connected socket, fall back to fd */ - err = sock->ops->getname(sock, (struct sockaddr *)&peer_address, &peer_address_len, 1); + err = sock_getname(sock, (struct sockaddr *)&peer_address, 1); } else - err = sock->ops->getname(sock, (struct sockaddr *)&peer_address, &peer_address_len, 1); + err = sock_getname(sock, (struct sockaddr *)&peer_address, 1); if (err == 0) { family = sock->sk->sk_family; @@ -863,8 +876,6 @@ u16 fd_to_socktuple(int fd, char *dest; struct sockaddr_storage sock_address; struct sockaddr_storage peer_address; - int sock_address_len; - int peer_address_len; /* * Get the socket from the fd @@ -882,7 +893,7 @@ u16 fd_to_socktuple(int fd, return 0; } - err = sock->ops->getname(sock, (struct sockaddr *)&sock_address, &sock_address_len, 0); + err = sock_getname(sock, (struct sockaddr *)&sock_address, 0); ASSERT(err == 0); family = sock->sk->sk_family; @@ -893,7 +904,7 @@ u16 fd_to_socktuple(int fd, switch (family) { case AF_INET: if (!use_userdata) { - err = sock->ops->getname(sock, (struct sockaddr *)&peer_address, &peer_address_len, 1); + err = sock_getname(sock, (struct sockaddr *)&peer_address, 1); if (err == 0) { if (is_inbound) { sip = ((struct sockaddr_in *) &peer_address)->sin_addr.s_addr; @@ -945,7 +956,7 @@ u16 fd_to_socktuple(int fd, break; case AF_INET6: if (!use_userdata) { - err = sock->ops->getname(sock, (struct sockaddr *)&peer_address, &peer_address_len, 1); + err = sock_getname(sock, (struct sockaddr *)&peer_address, 1); ASSERT(err == 0); if (is_inbound) { @@ -1020,7 +1031,7 @@ u16 fd_to_socktuple(int fd, if (is_inbound) { us_name = ((struct sockaddr_un *) &sock_address)->sun_path; } else { - err = sock->ops->getname(sock, (struct sockaddr *)&peer_address, &peer_address_len, 1); + err = sock_getname(sock, (struct sockaddr *)&peer_address, 1); ASSERT(err == 0); us_name = ((struct sockaddr_un *) &peer_address)->sun_path;