Difference between revisions of "Kernel code quotes"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(vlan buggyright)
(use source tag)
Line 2: Line 2:
  
 
----
 
----
<pre>
+
<source lang="c">
 
static char vlan_copyright[] = "...";
 
static char vlan_copyright[] = "...";
 
static char vlan_buggyright[] = "...";
 
static char vlan_buggyright[] = "...";
</pre>
+
</source>
  
 
:''from linux-2.6.24-rc5/net/8021q/vlan.c''
 
:''from linux-2.6.24-rc5/net/8021q/vlan.c''
Line 17: Line 17:
  
 
----
 
----
<pre>
+
<source lang="c">
 
/* This code sucks.  But you should have seen it before! --RR */
 
/* This code sucks.  But you should have seen it before! --RR */
</pre>
+
</source>
  
 
:''from linux-2.6.23/net/ipv4/route.c''
 
:''from linux-2.6.23/net/ipv4/route.c''
  
 
----
 
----
<pre>
+
<source lang="c">
 
static void dn_long_error_report(struct neighbour *neigh, struct sk_buff *skb)
 
static void dn_long_error_report(struct neighbour *neigh, struct sk_buff *skb)
 
{
 
{
Line 30: Line 30:
 
         kfree_skb(skb);
 
         kfree_skb(skb);
 
}
 
}
</pre>
+
</source>
  
 
:''from linux-2.6.23/net/decnet/dn_neigh.c''
 
:''from linux-2.6.23/net/decnet/dn_neigh.c''
  
 
----
 
----
<pre>
+
<source lang="c">
 
/* Unfortunately we don't support this one.  Any brave souls? */
 
/* Unfortunately we don't support this one.  Any brave souls? */
</pre>
+
</source>
  
 
:''from linux-2.6.23/include/linux/skbuff.h:skb_forward_csum()''
 
:''from linux-2.6.23/include/linux/skbuff.h:skb_forward_csum()''
  
 
----
 
----
<pre>
+
<source lang="c">
 
#define IT_ID_SET      1
 
#define IT_ID_SET      1
 
#define IT_ID_NOT_SET  0
 
#define IT_ID_NOT_SET  0
</pre>
+
</source>
  
 
:''from linux-2.6.23/kernel/posix-timers.c''
 
:''from linux-2.6.23/kernel/posix-timers.c''
  
 
----
 
----
<pre>
+
<source lang="c">
* "I ask you, have you ever known what it is to be an orphan?"
+
* "I ask you, have you ever known what it is to be an orphan?"
*/
+
*/
 
static int will_become_orphaned_pgrp(...
 
static int will_become_orphaned_pgrp(...
</pre>
+
</source>
  
 
:''from linux-2.6.23/kernel/exit.c''
 
:''from linux-2.6.23/kernel/exit.c''
  
 
----
 
----
<pre>
+
<source lang="c">
 
#ifndef I_WISH_WORLD_WERE_PERFECT
 
#ifndef I_WISH_WORLD_WERE_PERFECT
  
 
/* It is not :-( ...
 
/* It is not :-( ...
</pre>
+
</source>
  
 
:''from linux-2.6.23/net/ipv4/ip_gre.c:ipgre_err()''
 
:''from linux-2.6.23/net/ipv4/ip_gre.c:ipgre_err()''
Line 82: Line 82:
  
 
----
 
----
<pre>
+
<source lang="c">
 
static inline int sk_hashed(const struct sock *sk)
 
static inline int sk_hashed(const struct sock *sk)
 
{
 
{
 
         return !sk_unhashed(sk);
 
         return !sk_unhashed(sk);
 
}
 
}
</pre>
+
</source>
  
 
:''from linux-2.6.23/include/net/sock.h''
 
:''from linux-2.6.23/include/net/sock.h''

Revision as of 08:34, 25 December 2007

Here we're collecting some funny quotes from the linux kernel code


static char vlan_copyright[] = "...";
static char vlan_buggyright[] = "...";
from linux-2.6.24-rc5/net/8021q/vlan.c

So... these "amateur" devices are hopeless.
from linux-2.6.24-rc5/net/ipv4/arp.c:arp_constructor()

/* This code sucks.  But you should have seen it before! --RR */
from linux-2.6.23/net/ipv4/route.c

static void dn_long_error_report(struct neighbour *neigh, struct sk_buff *skb)
{
        printk(KERN_DEBUG "dn_long_error_report: called\n");
        kfree_skb(skb);
}
from linux-2.6.23/net/decnet/dn_neigh.c

/* Unfortunately we don't support this one.  Any brave souls? */
from linux-2.6.23/include/linux/skbuff.h:skb_forward_csum()

#define IT_ID_SET       1
#define IT_ID_NOT_SET   0
from linux-2.6.23/kernel/posix-timers.c

* "I ask you, have you ever known what it is to be an orphan?"
*/
static int will_become_orphaned_pgrp(...
from linux-2.6.23/kernel/exit.c

#ifndef I_WISH_WORLD_WERE_PERFECT

/* It is not :-( ...
from linux-2.6.23/net/ipv4/ip_gre.c:ipgre_err()

weird, but documented
from linux-2.6.23/net/packet/af_packet.c:packet_create()

What the above comment does talk about? --ANK(980817)
from linux-2.6.23/net/unix/af_unix.c:unix_release_sock()

static inline int sk_hashed(const struct sock *sk)
{
        return !sk_unhashed(sk);
}
from linux-2.6.23/include/net/sock.h

Instead of using a dedicated spinlock, we (ab)use inetsw_lock
from linux-2.6.23/net/ipv4/af_inet.c:build_ehash_secret()