diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py
index 69501fcee043efe69190c771a1a37d7af2176bbd..c62bed76f4df90fedf7498bcbe02a0f30dedcae3 100644
--- a/scapy/layers/inet6.py
+++ b/scapy/layers/inet6.py
@@ -390,7 +390,7 @@ class _IPv6GuessPayload:
             t = ord(p[0])
             if len(p) > 2 and (t == 139 or t == 140): # Node Info Query
                 return _niquery_guesser(p)
-            if len(p) >= icmp6typesminhdrlen.get(t, sys.maxint): # Other ICMPv6 messages
+            if len(p) >= icmp6typesminhdrlen.get(t, float("inf")): # Other ICMPv6 messages
                 return get_cls(icmp6typescls.get(t,"Raw"), "Raw")
             return Raw
         elif self.nh == 135 and len(p) > 3: # Mobile IPv6
diff --git a/scapy/layers/ppp.py b/scapy/layers/ppp.py
index 5bcc8e2db3fcd710449fd5ccd4bd6bbcc9d08517..6a16d3d7b1385758574f7444b59e4a024aa71d1c 100644
--- a/scapy/layers/ppp.py
+++ b/scapy/layers/ppp.py
@@ -256,7 +256,7 @@ class PPP_IPCP_Option(Packet):
     @classmethod
     def dispatch_hook(cls, _pkt=None, *args, **kargs):
         if _pkt:
-            o = ord(_pkt[0])
+            o = orb(_pkt[0])
             return cls.registered_options.get(o, cls)
         return cls