diff --git a/scapy.py b/scapy.py
index <HASH>..<HASH> 100755
--- a/scapy.py
+++ b/scapy.py
@@ -3611,10 +3611,15 @@ class Packet(Gen):
                 return f[attr]
         return self.payload.getfieldval(attr)
     
+    def getfield_and_val(self, attr):
+        for f in self.fields, self.overloaded_fields, self.default_fields:
+            if f.has_key(attr):
+                return self.fieldtype.get(attr),f[attr]
+        return self.payload.getfield_and_val(attr)
+    
     def __getattr__(self, attr):
         if self.initialized:
-            v = self.getfieldval(attr)
-            fld = self.fieldtype.get(attr,None)
+            fld,v = self.getfield_and_val(attr)
             if fld is not None:
                 return fld.i2h(self, v)
             return v
@@ -4395,6 +4400,8 @@ class NoPayload(Packet,object):
         return "",[]
     def getfieldval(self, attr):
         raise AttributeError(attr)
+    def getfield_and_val(self, attr):
+        raise AttributeError(attr)
     def __getattr__(self, attr):
         if attr in self.__dict__:
             return self.__dict__[attr]
Fixed bug in Packet.__getattr__()

The search for the field value was done recursively while the
field object search was only local. This prevented i2h() to be called
when the asked field was not in the first layer.