[RFC]__sock_create() change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

the __sock_create in net/socket.c has the following code snippet.

if (family == PF_INET && type == SOCK_PACKET) {
     static int warned;
     if (!warned) {
          warned = 1;
          printk(KERN_INFO "%s uses obsolete (PF_INET,SOCK_PACKET)\n", current->comm);
     }
     family = PF_PACKET;
}

this may be in place to emit a harmless warning , but why not change it to -
if (family == PF_INET && type == SOCK_PACKET) {

     printk(KERN_INFO "%s uses obsolete (PF_INET,SOCK_PACKET)\n", current->comm);

     family = PF_PACKET;
}

Because anyway if(!warning) is going to result in true everytime we enter the function, as static int warning has scope limited to the outer if block.

Comments?

Thank you
~psr
--
play the game

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux