commit 3fd3a9cfb5d755547263639da63ddf02c1da99bd from: Stefan Sperling date: Fri Aug 16 16:42:39 2024 UTC fix conf_patch to avoid overwriting the current interface being shown Afer conf_patch() was called, subsequent configuration items were being shown for the paired interface, rather than the pair interface itself. This happened because conf_patch() wrote the name of the paired interface into the interface name buffer provided by the caller. Use a local buffer instead. commit - 11d6e15cefcc75b4f00c31bcbfe78c0b5eec6340 commit + 3fd3a9cfb5d755547263639da63ddf02c1da99bd blob - b2f75596c7a2341b035284c80351db2dd73c1944 blob + 7da1c63710f2852205df3e10d461e0d6b93ab569 --- conf.c +++ conf.c @@ -874,13 +874,14 @@ void conf_vnetflowid(FILE *output, int ifs, char *ifna void conf_patch(FILE *output, int ifs, char *ifname) { struct ifreq ifr; + char ifix_buf[IFNAMSIZ]; memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); if (ioctl(ifs, SIOCGIFPAIR, &ifr) == 0 && ifr.ifr_index != 0 && - if_indextoname(ifr.ifr_index, ifname) != NULL) - fprintf(output, " patch %s\n", ifname); + if_indextoname(ifr.ifr_index, ifix_buf) != NULL) + fprintf(output, " patch %s\n", ifix_buf); } void conf_parent(FILE *output, int ifs, char *ifname)