Bug 9010

Summary: usernetctl does not detach - fixed
Product: [Retired] Red Hat Linux Reporter: Volker Wysk <volker.wysk>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: nalin, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-31 17:08:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Volker Wysk 2000-01-31 04:27:59 UTC
Hi. I hunted down and fixed a bug that caused /usr/sbin/usernetctl
not to detach after a ppp connection has benn successuflly established.
I'm using initscripts-4.84-1 (rawhide).

It is a bug in /usr/src/redhat/BUILD/initscripts-4.84/src/ppp-watch.c
(/sbin/ppp-watch), in interfaceStatus(): The error return code of socket()
is -1, not 0.

(Also, the man page says, the protocol family should be specified by a
macro beginning with "PF_", not "AF_". But the PF_... are defined as the
AF_... Is this portable?)

Here is the patch:

*** ppp-watch.c-alt	Mon Dec  6 20:18:02 1999
--- ppp-watch.c	Mon Jan 31 05:03:14 2000
***************
*** 373,386 ****
  static int
  interfaceStatus(char *device) {
!     int sock = 0;
!     int pfs[] = {AF_INET, AF_IPX, AF_AX25, AF_APPLETALK, 0};
      int p = 0;
      struct ifreq ifr;
      int retcode = 0;

!     while (!sock && pfs[p]) {
          sock = socket(pfs[p++], SOCK_DGRAM, 0);
      }
!     if (!sock) return 0;

      memset(&ifr, 0, sizeof(ifr));
--- 373,386 ----
  static int
  interfaceStatus(char *device) {
!     int sock = -1;
!     int pfs[] = {PF_INET, PF_IPX, PF_AX25, PF_APPLETALK, 0};
      int p = 0;
      struct ifreq ifr;
      int retcode = 0;

!     while ((sock == -1) && pfs[p]) {
          sock = socket(pfs[p++], SOCK_DGRAM, 0);
      }
!     if (sock == -1) return 0;

      memset(&ifr, 0, sizeof(ifr));

Comment 1 Bill Nottingham 2000-01-31 05:18:59 UTC
*** Bug 8978 has been marked as a duplicate of this bug. ***

Comment 2 Bill Nottingham 2000-01-31 17:08:59 UTC
Will be fixed in initscripts-4.85.